	
/*读EEPROM
	count = IapReadByte(0x0000);
	IapEraseSector(0x0000);       //擦除-写入	
	IapProgramByte(0x0000+2*i+1, fig[i].ID);	
*/
#ifndef _IDENTITYSTORETEST_
#define _IDENTITYSTORETEST_
#include "eeprom.h"
#include "uart.h"
#include "delay.h"

#define ID_COUNT 20//20个ID卡
//==================外部可见====================
//初始化
void identity_Store_Init();
//清除所有身份信息以及认证信息
void clear_identity();
//添加ID卡、//重复返回0x00、达到上线返回0x02、成功返回0x01
char add_ID(unsigned char* id);
//根据序列号返回匹配的ID
char ID_serialtoNum(unsigned char *id_num);
//检测ID卡
char check_ID(unsigned char *id);
//授权ID卡
void authorize_ID(char ID,char flag);

//检测指纹
char check_finger(char count);
//授权指纹
void authorize_finger(char ID,char flag);

 extern xdata unsigned char ID_NUM_char[ID_COUNT][4];
 extern idata unsigned char ID_authorize[3];
 extern idata unsigned char finger_authorize_char[3];
 extern idata unsigned char ID_NUM_COUNT;



#endif //_IDENTITYSTORETEST_